<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>搜索页面</title>

		<link href="../AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css" />
		<link href="../AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css" />

		<link rel="stylesheet" href="../../js/layui/css/layui.css" media="all">

		<link href="../basic/css/demo.css" rel="stylesheet" type="text/css" />

		<link href="../css/seastyle.css" rel="stylesheet" type="text/css" />

		<script type="text/javascript" src="../basic/js/jquery-1.7.min.js"></script>
		<script type="text/javascript" src="../js/script.js"></script>
	</head>

	<body>

		<!--顶部导航条 -->
		<div class="am-container header">
			<ul class="message-l">
				<div class="topMessage">
					<div class="menu-hd">
						<a href="login.html" target="_top" class="h" id="login">亲，请登录</a>
						<a href="register.html" target="_top">免费注册</a>
					</div>
				</div>
			</ul>
			<ul class="message-r">
				<div class="topMessage home">
					<div class="menu-hd"><a href="home2.html" target="_top" class="h">商城首页</a></div>
				</div>
				<div class="topMessage my-shangcheng">
					<div class="menu-hd MyShangcheng"><a href="index.html" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a></div>
				</div>
				<div class="topMessage mini-cart">
					<div class="menu-hd"><a id="mc-menu-hd" href="shopcart.html" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h">0</strong></a></div>
				</div>
				<div class="topMessage favorite">
			</ul>
			</div>

			<!--悬浮搜索框-->

			<div class="nav white">
				<div class="logo"><img src="../images/logo.png" /></div>
				<div class="logoBig">
					<li><img src="../images/logobig.png" /></li>
				</div>

				<div class="search-bar pr">
					<a name="index_none_header_sysc" href="search.html"></a>
					<form action="search.html">
						<input id="searchInput" name="product_name" type="text" placeholder="搜索" autocomplete="off">
						<input id="ai-topsearch" class="submit am-btn"  value="搜索" index="1" type="submit">
					</form>
				</div>
			</div>

			<div class="clear"></div>
			<b class="line"></b>
           <div class="search">
			<div class="search-list">
			<div class="nav-table">
					   <div class="long-title"><span class="all-goods">全部分类</span></div>
					   <div class="nav-cont">
							<ul>
								<li class="index"><a href="home2.html">首页</a></li>
							</ul>
						    <div class="nav-extra">
						    	<i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>我的福利
						    	<i class="am-icon-angle-right" style="padding-left: 10px;"></i>
						    </div>
						</div>
			</div>
			
				
					<div class="am-g am-g-fixed">
						<div class="am-u-sm-12 am-u-md-12">
	                  	<div class="theme-popover">														
							
							<ul class="select">
								<p class="title font-normal">
									<!-- <span class="fl">松子</span> -->
									<span class="total fl">搜索到<strong class="num" ><font color="#FF0000" id="count" size="6px"> 0.0</font></strong>件相关商品</span>
								</p>
								
						
								<li class="select-list">
									<dl id="select2">
										<dt class="am-badge am-round">种类</dt>
										<div class="dd-conent" id="productCategory">
											<dd ><a href="?product_category=1">全部</a></dd>
										</div>
									</dl>
								</li>
							
					         <!-- 价格区间 -->
					         <li class="select-list">
					         <dl id="select2">
										<dt class="am-badge am-round">价格</dt>
										<div class="dd-conent">
											<dd >
											<input type="text" id="begin_discountprice" placeholder="￥"  autocomplete="off">-
											<input type="text" id="end_discountprice"  placeholder="￥"  autocomplete="off">
											<a href="javascript:;" onclick="chaxun()">检索</a>
											</dd>
										</div>
									</dl>
					        <!--  <div class="info-main">
					         
					         	<div class="am-form-group">
									
									<div class="am-form-content">
									<label for="user-name" class="am-form-label">价格</label>
										<input type="text" id="" placeholder="￥"  autocomplete="off">-
										<input type="text" id=""  placeholder="￥"  autocomplete="off">
                                          
									</div>
								</div>
								</div> -->
					         </li>
							</ul>
							<div class="clear"></div>
                        </div>
							<div class="search-content">
								<div class="sort">
									<li class="first"><a title="综合">综合排序</a></li>
									<li><a href="?product_count=1" title="销量">销量排序</a></li>
									<li><a href="?product_price=1" title="价格">价格优先</a></li>
									<!-- <li class="big"><a title="评价" href="#">评价为主</a></li> -->
								</div>
								<div class="clear"></div>

								<ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-4 boxes" id="product_ul">
									<!-- <li>
										<div class="i-pic limit">
											<img src="../images/imgsearch1.jpg" />											
											<p class="title fl">【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮</p>
											<p class="price fl">
												<b>¥</b>
												<strong>56.90</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li>
									<li>
										<div class="i-pic limit">
											
											<img src="../images/imgsearch1.jpg" />
											<p class="title fl">手剥松子218g 坚果炒货零食新货巴西松子包邮</p>
											<p class="price fl">
												<b>¥</b>
												<strong>56.90</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li>
									<li>
										<div class="i-pic limit">
											
											<img src="../images/imgsearch1.jpg" />
											<p class="title fl">【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮</p>
											<p class="price fl">
												<b>¥</b>
												<strong>56.90</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li>
									<li>
										<div class="i-pic limit">
											
											<img src="../images/imgsearch1.jpg" />
											<p class="title fl">手剥松子218g 坚果炒货零食新货巴西松子包邮</p>
											<p class="price fl">
												<b>¥</b>
												<strong>56.90</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li>
									<li>
										<div class="i-pic limit">
											
											<img src="../images/imgsearch1.jpg" />
											<p class="title fl">【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮</p>
											<p class="price fl">
												<b>¥</b>
												<strong>56.90</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li>
									<li>
										<div class="i-pic limit">
											
											<img src="../images/imgsearch1.jpg" />
											<p class="title fl">【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮</p>
											<p class="price fl">
												<b>¥</b>
												<strong>56.90</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li>
									<li>
										<div class="i-pic limit">
											
											<img src="../images/imgsearch1.jpg" />
											<p class="title fl">【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮</p>
											<p class="price fl">
												<b>¥</b>
												<strong>56.90</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li>
									<li>
										<div class="i-pic limit">
											
											<img src="../images/imgsearch1.jpg" />
											<p class="title fl">【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮</p>
											<p class="price fl">
												<b>¥</b>
												<strong>56.90</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li>
									<li>
										<div class="i-pic limit">
											
											<img src="../images/imgsearch1.jpg" />
											<p class="title fl">【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮</p>
											<p class="price fl">
												<b>¥</b>
												<strong>56.90</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li>
									<li>
										<div class="i-pic limit">
											
											<img src="../images/imgsearch1.jpg" />
											<p class="title fl">【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮</p>
											<p class="price fl">
												<b>¥</b>
												<strong>56.90</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li>
									<li>
										<div class="i-pic limit">
											
											<img src="../images/imgsearch1.jpg" />
											<p class="title fl">【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮</p>
											<p class="price fl">
												<b>¥</b>
												<strong>56.90</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li>
									<li>
										<div class="i-pic limit">
											
											<img src="../images/imgsearch1.jpg" />
											<p class="title fl">【良品铺子旗舰店】手剥松子218g 坚果炒货零食新货巴西松子包邮</p>
											<p class="price fl">
												<b>¥</b>
												<strong>56.90</strong>
											</p>
											<p class="number fl">
												销量<span>1110</span>
											</p>
										</div>
									</li> -->
								</ul>
							</div>
							<!-- <div class="search-side">

								<div class="side-title">
									经典搭配
								</div>

								<li>
									<div class="i-pic check">
										<img src="../images/cp.jpg" />
										<p class="check-title">萨拉米 1+1小鸡腿</p>
										<p class="price fl">
											<b>¥</b>
											<strong>29.90</strong>
										</p>
										<p class="number fl">
											销量<span>1110</span>
										</p>
									</div>
								</li>
								<li>
									<div class="i-pic check">
										<img src="../images/cp2.jpg" />
										<p class="check-title">ZEK 原味海苔</p>
										<p class="price fl">
											<b>¥</b>
											<strong>8.90</strong>
										</p>
										<p class="number fl">
											销量<span>1110</span>
										</p>
									</div>
								</li>
								<li>
									<div class="i-pic check">
										<img src="../images/cp.jpg" />
										<p class="check-title">萨拉米 1+1小鸡腿</p>
										<p class="price fl">
											<b>¥</b>
											<strong>29.90</strong>
										</p>
										<p class="number fl">
											销量<span>1110</span>
										</p>
									</div>
								</li>

							</div> -->
							<div class="clear"></div>
							<!--分页 -->
							<ul class="am-pagination am-pagination-right" id="page">
								
							</ul>

						</div>
					</div>
					<div class="footer">
						<div class="footer-hd">
							<p>
								<b>|</b>
								<a href="home2.html">商城首页</a>
								<b>|</b>
								<a href="# ">支付宝</a>
								<b>|</b>
								<a href="# ">物流</a>
							</p>
						</div>
						<div class="footer-bd ">
							<p>
								<a href="# ">合作伙伴</a>
								<a href="# ">联系我们</a>
								<a href="# ">网站地图</a>
							</p>
						</div>
					</div>
				</div>

			</div>

		<!--引导 -->
		<div class="navCir">
			<li><a href="home2.html"><i class="am-icon-home "></i>首页</a></li>
			<li><a href="sort.html"><i class="am-icon-list"></i>分类</a></li>
			<li><a href="shopcart.html"><i class="am-icon-shopping-basket"></i>购物车</a></li>	
			<li><a href="../person/index.html"><i class="am-icon-user"></i>我的</a></li>					
		</div>

		<!--菜单 -->
		<div class=tip>
			<div id="sidebar">
				<div id="wrap">
					<div id="prof" class="item">
						<a href="#">
							<span class="setting"></span>
						</a>
						<div class="ibar_login_box status_login">
							<div class="avatar_box">
								<p class="avatar_imgbox"><img src="../images/no-img_mid_.jpg" /></p>
								<ul class="user_info">
									<li>用户名：sl1903</li>
									<li>级&nbsp;别：普通会员</li>
								</ul>
							</div>
							<div class="login_btnbox">
								<a href="#" class="login_order">我的订单</a>
								<a href="#" class="login_favorite">我的收藏</a>
							</div>
							<i class="icon_arrow_white"></i>
						</div>

					</div>
					<div id="shopCart" class="item">
						<a href="#">
							<span class="message"></span>
						</a>
						<p>
							购物车
						</p>
						<p class="cart_num">0</p>
					</div>
					<div id="asset" class="item">
						<a href="#">
							<span class="view"></span>
						</a>
						<div class="mp_tooltip">
							我的资产
							<i class="icon_arrow_right_black"></i>
						</div>
					</div>

					<div id="foot" class="item">
						<a href="#">
							<span class="zuji"></span>
						</a>
						<div class="mp_tooltip">
							我的足迹
							<i class="icon_arrow_right_black"></i>
						</div>
					</div>

					<div id="brand" class="item">
						<a href="#">
							<span class="wdsc"><img src="../images/wdsc.png" /></span>
						</a>
						<div class="mp_tooltip">
							我的收藏
							<i class="icon_arrow_right_black"></i>
						</div>
					</div>

					<div id="broadcast" class="item">
						<a href="#">
							<span class="chongzhi"><img src="../images/chongzhi.png" /></span>
						</a>
						<div class="mp_tooltip">
							我要充值
							<i class="icon_arrow_right_black"></i>
						</div>
					</div>

					<div class="quick_toggle">
						<li class="qtitem">
							<a href="#"><span class="kfzx"></span></a>
							<div class="mp_tooltip">客服中心<i class="icon_arrow_right_black"></i></div>
						</li>
						<!--二维码 -->
						<li class="qtitem">
							<a href="#none"><span class="mpbtn_qrcode"></span></a>
							<div class="mp_qrcode" style="display:none;"><img src="../images/weixin_code_145.png" /><i class="icon_arrow_white"></i></div>
						</li>
						<li class="qtitem">
							<a href="#top" class="return_top"><span class="top"></span></a>
						</li>
					</div>

					<!--回到顶部 -->
					<div id="quick_links_pop" class="quick_links_pop hide"></div>

				</div>

			</div>
			<div id="prof-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					我
				</div>
			</div>
			<div id="shopCart-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					购物车
				</div>
			</div>
			<div id="asset-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					资产
				</div>

				<div class="ia-head-list">
					<a href="#" target="_blank" class="pl">
						<div class="num">0</div>
						<div class="text">优惠券</div>
					</a>
					<a href="#" target="_blank" class="pl">
						<div class="num">0</div>
						<div class="text">红包</div>
					</a>
					<a href="#" target="_blank" class="pl money">
						<div class="num">￥0</div>
						<div class="text">余额</div>
					</a>
				</div>

			</div>
			<div id="foot-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					足迹
				</div>
			</div>
			<div id="brand-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					收藏
				</div>
			</div>
			<div id="broadcast-content" class="nav-content">
				<div class="nav-con-close">
					<i class="am-icon-angle-right am-icon-fw"></i>
				</div>
				<div>
					充值
				</div>
			</div>
		</div>
		<script>
			window.jQuery || document.write('<script src="basic/js/jquery-1.9.min.js"><\/script>');
		</script>
		<script type="text/javascript" src="../basic/js/quick_links.js"></script>

<div class="theme-popover-mask"></div>

<script type="text/javascript" >




</script>
<script src="../../js/layui/layui.js"></script>
<script type="text/javascript">
function getUrlParam(key) {
    // 获取参数
    var url = window.location.search;
    // 正则筛选地址栏
    var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
    // 匹配目标参数
    var result = url.substr(1).match(reg);
    //返回参数值
    return result ? decodeURIComponent(result[2]) : null;
}
if (getUrlParam("product_name")==null) {
			product_name=''; 
		}else{
			product_name=getUrlParam("product_name");
		}
	
		if (getUrlParam("product_price")==null) {
			product_price=0; 
		}else{
			product_price=1;
		}

		if (getUrlParam("product_count")==null) {
			product_count=0; 
		}else{
			product_count=1;
		}
		
	
		
		
		
		function category(t_id){
			var currentpage = 0;//初始page
			layui.use('laypage', function(){
				  var laypage = layui.laypage;
				  //执行一个laypage实例
				  laypage.render({
				    elem: 'page' //注意，这里的 test1 是 ID，不用加 # 号
				    ,count: 100//数据总数，从服务端得到
				    ,limit:12
				    ,jump: function(obj, first){
				    	 //obj包含了当前分页的所有参数，比如：
				        //console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
				        //console.log(obj.limit); //得到每页显示的条数
				        
				        $.post("../../product_Category_ViewAlls",{
							page:obj.curr,
							limit:obj.limit,
							product_name:product_name,
							begin_discountprice:$("#begin_discountprice").val(),
							end_discountprice:$("#end_discountprice").val(),
							product_category:t_id,
							product_price:product_price,
							product_count:product_count
							},function(res){
								console.log(res);
								$("#count").html(res.count);
								if (res!=null) {
									$("#product_ul").html("");
									for (var i = 0; i < res.data.length; i++) {
										
										$("#product_ul").append(`
												<li><a href="introduction.html?product_id=${res.data[i].product_id}">
												<div class="i-pic limit">
													<img src="../../static/admin/images/${res.data[i].product_img}" />											
													<p class="title fl">${res.data[i].product_name}</p>
													<p class="price fl">
														<b>¥</b>
														<strong>${res.data[i].product_price}</strong>
													</p>
													<p class="number fl">
														销量<span>${res.data[i].product_count}</span>
													</p>
												</div>
												</a></li>
												`)
									}
								} else {
									alert("无数据");
								}
							
						},"json");
				        
				       
				      }
				
				    
				  });
				});
		}
		
		
</script>
<script type="text/javascript">
$(function(){

	$.post("../../productTypeType",{},function(res){
		//?product_category=${res[i].t_id}
		for (var i = 0; i < res.length; i++) {
			$("#productCategory").append(`	
					<dd><a href="javascript:;" onclick="category(${res[i].t_id})">${res[i].t_name}</a></dd>
			`);
		}
	},"json");

})
function chaxun(){
	var currentpage = 0;//初始page
	layui.use('laypage', function(){
		  var laypage = layui.laypage;
		  
		  //执行一个laypage实例
		  laypage.render({
		    elem: 'page' //注意，这里的 test1 是 ID，不用加 # 号
		    ,count: 100//数据总数，从服务端得到
		    ,limit:12
		    ,jump: function(obj, first){
		    	 //obj包含了当前分页的所有参数，比如：
		        //console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
		        //console.log(obj.limit); //得到每页显示的条数
		        
		        $.post("../../product_Category_ViewAlls",{
					page:obj.curr,
					limit:obj.limit,
					product_name:product_name,
					begin_discountprice:$("#begin_discountprice").val(),
					end_discountprice:$("#end_discountprice").val(),
					product_category:0,
					product_price:product_price,
					product_count:product_count
					},function(res){
						$("#count").html(res.count);
						if (res!=null) {
							$("#product_ul").html("");
							for (var i = 0; i < res.data.length; i++) {
								
								$("#product_ul").append(`
										<li><a href="introduction.html?product_id=${res.data[i].product_id}">
										<div class="i-pic limit">
											<img src="../../static/admin/images/${res.data[i].product_img}" />											
												<p class="title fl">${res.data[i].product_name}</p>
											<p class="price fl">
												<b>¥</b>
												<strong>${res.data[i].product_price}</strong>
											</p>
											<p class="number fl">
												销量<span>${res.data[i].product_count}</span>
											</p>
										</div>
										</a></li>
										`)
							}
						} else {
							alert("无数据");
						}
					
				},"json");
		        
		       
		      }
		
		    
		  });
		});
}

var currentpage = 0;//初始page
layui.use('laypage', function(){
	  var laypage = layui.laypage;
	  
	  //执行一个laypage实例
	  laypage.render({
	    elem: 'page' //注意，这里的 test1 是 ID，不用加 # 号
	    ,count: 100//数据总数，从服务端得到
	    ,limit:12
	    ,jump: function(obj, first){
	    	 //obj包含了当前分页的所有参数，比如：
	        //console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
	        //console.log(obj.limit); //得到每页显示的条数
	        
	        $.post("../../product_Category_ViewAlls",{
				page:obj.curr,
				limit:obj.limit,
				product_name:product_name,
				begin_discountprice:$("#begin_discountprice").val(),
				end_discountprice:$("#end_discountprice").val(),
				product_category:'',
				product_price:product_price,
				product_count:product_count
				},function(res){
					$("#count").html(res.count);
					if (res!=null) {
						$("#product_ul").html("");
						for (var i = 0; i < res.data.length; i++) {
							console.log(res);
							$("#product_ul").append(`
									<li><a href="introduction.html?product_id=${res.data[i].product_id}">
									<div class="i-pic limit">
										<img src="../../static/admin/images/${res.data[i].product_img}" />											
										<p class="title fl">${res.data[i].product_name}</p>
										<p class="price fl">
											<b>¥</b>
											<strong>${res.data[i].product_price}</strong>
										</p>
										<p class="number fl">
											销量<span>${res.data[i].product_count}</span>
										</p>
									</div>
								</a></li>
									`)
						}
					} else {
						alert("无数据");
					}
				
			},"json");
	        
	       
	      }
	
	    
	  });
	});

	</script>
	<script type="text/javascript">
/* 	 var url = window.location.href;
	 var valiable = url.split("?")[0];
	 window.history.pushState({},0,valiable); */
	</script>
	<script type="text/javascript">
		//不锁的页面需要用到的东西
		$(function(){
			if (localStorage.getItem("user_id")!=null) {
				//$("#login").html(localStorage.getItem("user_fullname"));
				document.getElementById('login').innerHTML = localStorage.getItem("user_fullname");
			}
		})
		</script>
		




	</body>

</html>